////////////////////////////////////////////////////////////////////////////////////
/* Program: This file contains instructions to launch the Decision Layer code.
 *			To do so, a TargetListener and ModeListener are created and a new
 *			thread for each is launched using the Run function within each
 *			object.  A global integer variable to represent the current mode of
 *			the system is created and a reference to the variable is passed to
 *			each thread that is created.
* Author:	Robert Wunderlich
 * Editors: Ryan Bell, Eric Cleveland, Sean Pierce (Team PAINTeK)
 * Purpose: Necessary for the SENTINEL system to keep track of what mode the
 *			system is in and which targets and commands to pass on to the
 *			Execution Layer.  Accepts socket input from Image Processing and
 *			User Interface Layers.  Outputs via sockets to the UI Layer and
 *			function calls to the Execution Layer.  Passes a reference to the
 *			mode variable to each thread that is created.
 * Misc:	
 */

/* *************** Reference: **************************
	Not applicable

************************************************** */

#include "ModeListener.h"
#include "TargetListener.h"

//#include "DecisionLayerVariable.h"
//#include "ExecutionLayer\Execution Layer.cpp"

int mode;
//ExecutionLayer* Sentinel = new ExecutionLayer();

int main()
{
	// global variable
	DecisionLayerVariable* GV = new DecisionLayerVariable();

	ModeListener ML;
	ML.Run(GV);
	TargetListener TL;
	TL.Run(GV);
	
	std::cout << "Decision Layer running...\n";

	while (ML.IsThreadActive() || TL.IsThreadActive())
			::Sleep( 1000 );

	//Test code below should be commented or deleted from final version
//	ML.Test_Listen();
//	system("PAUSE");
}